#include<iostream>
#include<cstring> 
using namespace std;
const int N = 110;
char g[N][N];
bool st[N][N];
int x1, y1, x2, y2;
int n;
int dx[] = { 0,-1,0,1 };
int dy[] = { -1,0,1,0 };
int dfs(int x, int y)
{
	if (x == x2 && y == y2) {
		return 1;
	}
	st[x][y] = 1;
	for (int i = 0; i < 4; i++) {
		int a = dx[i] + x;
		int b = dy[i] + y;
		if (a < 0 || a >= n || b < 0 || b >= n)continue;
		if (g[a][b] == '#')continue;
		if (st[a][b])continue;
		if (dfs(a, b)) {
			return 1;
		}
	}
	return 0;
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(st, 0, sizeof(st));
		memset(g, 0, sizeof(g));
		for (int i = 0; i < n; i++) {
			cin >> g[i];
		}
		cin >> x1 >> y1 >> x2 >> y2;
		int ans = dfs(x1, y1);
		if (ans) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}
